import requests

upload_url = "https://nmtp.youdao.com/api/organize/1514708/image/upload"
my_headers = {
    "cookie": """_ga=GA1.2.465781817.1655621565; OUTFOX_SEARCH_USER_ID_NCOO=298335832.6827876; OUTFOX_SEARCH_USER_ID="-1928168192@10.108.162.139"; _gid=GA1.2.887797372.1683464218; SESSION=e2d1a5e9-383c-45e5-8fec-93751cca6ff7; NTES_SESS=L7_cBaqbgUW3dx3NPAfqk3gDzNhOL2MBs1JzS0uASPUQd3GbdnHABweRPIC5ySkrNXcPF1WNeStnjOsCWjBRaMpgpq4ExFuFUwouMBULf2RSJPjbNEXRu_uEYau.6wtqakUPaS0K91GOBK8QmDvfw7mxgBPCMiSZ4W8mUfk_f9akK6s..AmsKDWd.zL4JmS8PWWHe0LNAd6XFEuh2H1jyJxjK; S_INFO=1683464233|0|##|974381044@qq.com; P_INFO=974381044@qq.com|1683464233|0|youdao_jianwai|00&99|sic&1681733877&youdao_jianwai#sic&510100#10#0#0|&0||974381044@qq.com"""
}
my_files = {
    "file": open(r".\1624958787.png", 'rb')
}

# rep = requests.post(url=upload_url, headers=my_headers, files=my_files)
rep = requests.request(method='post', url=upload_url, headers=my_headers, files=my_files)
# print(rep.json())
print(rep.text)
# 当前响应的编码格式
print(rep.encoding)
# 修改编码格式
rep.encoding = 'GBK'
print(rep.text)
# 响应码
print(rep.status_code)